package main

import "fmt"

func generateYHSJ(numRows int) [][]int {
	fmt.Println("*** starting ***")
	line := dgg(5)
	fmt.Println("line: ", line)
	if numRows == 1 {
		return [][]int{{1}}
	}
	return [][]int{{1}, {1, 1}}
}

func dgg(n int) []int {
	if n == 1 {
		return []int{1}
	} else if n == 2 {
		return []int{1, 1}
	} else {
		var (
			rnums     []int
			lastrnums = dgg(n - 1)
		)
		rnums = append(rnums, 1)
		for i := 1; i < len(lastrnums); i++ {
			rnums = append(rnums, lastrnums[i-1]+lastrnums[i])
		}
		rnums = append(rnums, 1)
		return rnums
	}
}
